If pure sniffing yields uncertain results, try again with the filename.
authorMatthias Clasen <matthiasc@src.gnome.org>
Sun, 1 Mar 2009 07:39:03 +0000 (07:39 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 1 Mar 2009 07:39:03 +0000 (07:39 +0000)
        * gdk-pixbuf-io.c (_gdk_pixbuf_get_module): If pure sniffing
        yields uncertain results, try again with the filename.
        Patch by Tyler Lawson

svn path=/trunk/; revision=22433

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-io.c

index 385577a4ad197e9927f1cc6b37a515269a5c50ee..d16222dbcb2776288cf6dc6c803981bff75d26f3 100644 (file)
@@ -1,3 +1,12 @@
+2009-03-01  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 569671 – gdk_pixbuf_new_from_file() can't open
+       image/x-portable-pixmap
+
+       * gdk-pixbuf-io.c (_gdk_pixbuf_get_module): If pure sniffing
+       yields uncertain results, try again with the filename.
+       Patch by Tyler Lawson
+
 2009-02-17  Matthias Clasen  <mclasen@redhat.com>
 
        * === Released 2.15.4 ===
index b1b9be24bdc76ff279dde82771ad8ad7a4c6276f..abb920359e3873feb914737b018c33a87ecb6826 100644 (file)
@@ -793,8 +793,11 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size,
        gchar **mimes;
        gchar *type;
        gint j;
+       gboolean uncertain;
 
-       mime_type = g_content_type_guess (NULL, buffer, size, NULL);
+       mime_type = g_content_type_guess (NULL, buffer, size, &uncertain);
+       if (uncertain)
+               mime_type = g_content_type_guess (filename, buffer, size, NULL);
 
        for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) {
                GdkPixbufModule *module = (GdkPixbufModule *)modules->data;